import request from '@/config/axios'

export interface DataPushLogVO {
  id: number
  reqRaw: string
  success: boolean
  seq: number
  respRaw: string
  errorMsg: string
  moduleId: number
  reqTime: Date
  respTime: Date
}

// 查询数据推送日志分页
export const getDataPushLogPage = async (params) => {
  return await request.get({ url: `/system/data-push-log/page`, params })
}
// 查询数据推送日志列表
export const getDataPushLogList = async (params) => {
  return await request.get({ url: `/system/data-push-log/list`, params })
}

// 查询数据推送日志详情
export const getDataPushLog = async (id: number) => {
  return await request.get({ url: `/system/data-push-log/get?id=` + id })
}

// 新增数据推送日志
export const createDataPushLog = async (data: DataPushLogVO) => {
  return await request.post({ url: `/system/data-push-log/create`, data })
}

// 修改数据推送日志
export const updateDataPushLog = async (data: DataPushLogVO) => {
  return await request.put({ url: `/system/data-push-log/update`, data })
}

// 删除数据推送日志
export const deleteDataPushLog = async (id: number) => {
  return await request.delete({ url: `/system/data-push-log/delete?id=` + id })
}

// 导出数据推送日志 Excel
export const exportDataPushLog = async (params) => {
  return await request.download({ url: `/system/data-push-log/export-excel`, params })
}

// 数据推送重试
export const retryDataPush = async (id: number) => {
  return await request.post({ url: `/system/data-push-log/retry?id=` + id })
}
